package com.lykj.llw.box.adapter.agent

import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.lykj.llw.box.R
import com.lykj.llw.box.data.bean.response.agent.AgentLookEarningResponse
import java.text.SimpleDateFormat

/**
 * ================================================
 * 数据查询列表适配器
 * ================================================
 *
 * @author gosha
 * @date 2023/11/14-15:55
 */
class AgentDataQueryAdapter :
    BaseQuickAdapter<AgentLookEarningResponse.DataDTO.RowsDTO, BaseViewHolder>(R.layout.item_look_earning) {
    val sdfs = SimpleDateFormat("yyyy-MM-dd HH:mm:ss")
    val sdfd = SimpleDateFormat("yyyy.MM.dd-HH:mm")

    override fun convert(holder: BaseViewHolder, item: AgentLookEarningResponse.DataDTO.RowsDTO) {
        holder.setText(R.id.tv_play_name, "${item.gamename}")
        holder.setText(R.id.tv_recharge, "${item.payMoney}")
        holder.setText(R.id.tv_earning, "${item.amount}")
        holder.setText(R.id.tv_time, "${sdfd.format(sdfs.parse(item.time))}")
    }
}